﻿@using KPIS.GERP.Models.ICM
@model KPIS.GERP.Models.ICM.Committee


@if (ViewContext.RouteData.Values["action"].ToString().ToLower() == "edit")
{
    @Html.HiddenFor(model => model.CommitteeId)
}
@Html.HiddenFor(model => model.CommitteeGroupId)
@Html.HiddenFor(model => model.CommitteeType)
@Html.HiddenFor(model => model.RecordStatus)
@Html.HiddenFor(model => model.CreatedBy)
@Html.HiddenFor(model => model.CreatedWhen)
@Html.HiddenFor(model => model.UpdatedBy)
@Html.HiddenFor(model => model.UpdatedWhen)

@{
    var LookupService = new KPIS.GERP.WEB.GIMS.IcmMasLookUpService.IcmMasLookUpServiceClient();
}

<div class="clearfix">
    <div class="row-fluid">
        <div class="span6"><h4 class="text-info">เลือกรายการที่ต้องการ @ViewBag.PcTypeName</h4></div>
        <div class="span6"><h4 class="text-error pull-right">@ViewBag.YearTypeName @ViewBag.BgYear</h4></div>
    </div>
    <div class="row-fluid">
		<div class="control-group">
			<div class="control-label">
				@Html.DisplayNameFor(model => model.ComFunctionId)
			</div>
			<div class="controls">   
				@Html.DropDownListFor(model => model.ComFunctionId, LookupService.MasLookUpSelectList(KPIS.GERP.Models.ICM.IcmMasLookUpType.LookUpType.CommitteeFunction)
                    
                    , new { id = "ddlComFunctionId", @class = "chzn-select", @readonly = "true" })@*, "เลือกหน้าที่ความรับผิดชอบ"*@
                @Html.Raw("&nbsp<font color=red>*</font>")
				@Html.ValidationMessageFor(model => model.ComFunctionId)
			</div>            
		</div>
		<div class="control-group">
			<div class="control-label">
				@Html.DisplayNameFor(model => model.Code)
			</div>
			<div class="controls">
				@Html.EditorFor(model => model.Code, new {placeholder = "ใส่ข้อมูลเลขที่ชุด"})
                @Html.Raw("&nbsp<font color=red>*</font>")
				@Html.ValidationMessageFor(model => model.Code)
			</div>            
		</div>
		<div class="control-group">
			<div class="control-label">
                @Html.DisplayNameFor(model => model.ComPositionId)
			</div>
			<div class="controls">
				@Html.DropDownListFor(model => model.ComPositionId, LookupService.MasLookUpSelectList(KPIS.GERP.Models.ICM.IcmMasLookUpType.LookUpType.CommitteePosition)
                    , new { @class = "chzn-select" })@*, "เลือกตำแหน่งคณะกรรมการ"*@
				@Html.Raw("&nbsp<font color=red>*</font>")
                @Html.ValidationMessageFor(model => model.ComPositionId)
			</div>
		</div>
        <div class="control-group">
			<div class="control-label">
                @Html.DisplayNameFor(model => model.ComTypeId)
			</div>
			<div class="controls" id="content">
                @{ int i = 0; }
				@foreach (var comptype in LookupService.MasLookUpSelectList(KPIS.GERP.Models.ICM.IcmMasLookUpType.LookUpType.CommitteeType))
				{ 
					@Html.RadioButtonFor(m => m.ComTypeId, comptype.Value, new { @id = "rbtComType" + i.ToString()})
                    <label for="@("rbtComType" + i.ToString())" class="lbl"> @comptype.Text </label> 
                    @Html.Raw("&nbsp&nbsp")
                    if (i == 0){
                        @Html.Raw("&nbsp&nbsp&nbsp")
                        @Html.DropDownListFor(model => model.EmpId
                            , new KPIS.GERP.WEB.GIMS.EmployeeService.EmployeeServiceClient().EmployeesSelectList(
                                new KPIS.GERP.Models.HRM.Employee()
                                {
                                    RecordStatus = "!" + KPIS.GERP.Models.SYS.RecordStatus.DeletedStatus
                                    , EmpTypeId = 1
                                }, true), new { @class = "chzn-select", id="ddlEmpId" })@*, "เลือกชื่อคณะกรรมการ"*@
                        @Html.Raw("&nbsp<font color=red>*</font>")
                        @Html.ValidationMessageFor(model => model.EmpId)
                        @Html.Raw("<br />") 
                    }else{                                
                        @Html.TextBoxFor(model => model.EmpName, new {placeholder = "ใส่ข้อมูลชื่อคณะกรรมการ", id="txtEmpName"})
                        @Html.ValidationMessageFor(model => model.EmpName)
                    }          
					i++;
				} 
			</div>
		</div>
        <div class="control-group">
			<div class="control-label">
                ตำแหน่ง
			</div>
			<div class="controls"> 
				@Html.TextBoxFor(model => model.EmpPositionName, new { id = "txtEmpPositionName" }) 
				@Html.ValidationMessageFor(model => model.EmpPositionName)
			</div>
		</div>
        <div class="control-group">
			<div class="control-label">
                @Html.DisplayName("รายละเอียด")
			</div>
			<div class="controls">
				@Html.TextAreaFor(model => model.DeleteReason, new { style="height:150px", @class="input-xlarge" })
				@*@Html.ValidationMessageFor(model => model.DeleteReason)  *@
			</div>
		</div>
	</div>
</div>
